<script type="text/javascript" src="<?php echo bu('/ckeditor/ckeditor.js'); ?>"></script>
<script type="text/javascript" src="<?php echo bu('/ckeditor/adapters/jquery.js'); ?>"></script>

<script>
  $(function()
  {
    var config = {
      skin:'kama',
      height:300,
      linkShowAdvancedTab: false,
       toolbar_Full: [
                            ['Styles','Format','Font','FontSize'],
                            ['Bold','Italic','Underline','StrikeThrough','-','Undo','Redo','-','Cut','Copy','Paste','Find','Replace','-','Outdent','Indent','-','Print'],
                            ['NumberedList','BulletedList','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
                            ['Image','Table','-','Link', 'TextColor','BGColor','Source'],
                          ],
    };

    $('.ckeditor').ckeditor(config);
  });
</script>

<div class="main-content">
	<header>
		<h2>Member Program - <?php echo $program->name; ?></h2>
	</header>

	<section>
    <?php
      $form = $this->beginWidget('CActiveForm', array(
        'id' => 'form',
        'action' => bu('admin/programs/update'),
        'htmlOptions' => array(
          'class' => 'form',
          'novalidate' => 'true',
          'enctype' => 'multipart/form-data',
        ),
      ));
    ?>

      <img src="<?php echo bu("assets/programs/".$program->logo); ?>" class="logo_preview" />
			<fieldset>
        <?php echo $form->errorSummary($program); ?>

				<legend>Please insert your program content</legend>
				<label>Change your logo</label>
        <?php echo CHtml::activeFileField($program, 'upload'); ?>

				<label>Name <em>*</em></label>
        <?php echo $form->textField($program, 'name', array('required' => 'required')); ?>

				<label>Long Name <em>*</em></label>
        <?php echo $form->textField($program, 'long_name', array('required' => 'required')); ?>

        <label>Description</label>
        <?php echo $form->textArea($program, 'description', array('style' => 'width:400px; height:150px;')); ?>

        <label>Content <em>*</em></label>
        <div style="border:1px solid #FFF; float:left;">
          <?php echo $form->textArea($program, 'content', array('required' => 'required', 'style' => 'width:400px; height:300px', 'class' => 'ckeditor')); ?>
        </div>

        <input type="hidden" name="type" value="<?php echo $id; ?>" />

				<div class="action" style="position:relative; top:10px;">
						<button class="button button-gray" type="submit"><span class="accept"></span>OK</button>
						<button class="button button-gray" type="reset">Reset</button>
				</div>
			</fieldset>
    <?php $this->endWidget(); ?>
	</section>
</div>